{extend name="../../base/view/common/base" /}
{block name="style"}
<style>
    .layui-form-item .layui-form-label {
        width: 120px;
    }
    .layui-form-item .layui-input-block {
        margin-left: 140px;
    }
</style>
{/block}
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">新增联系电话</h3>
    <table class="layui-table layui-table-form">
	  <tr>
		<td class="layui-td-gray">法院名称</td>
		<td colspan="3">{$court_name}</td>
	  </tr>
        <input type="hidden" name="court_id" value="{$court_id}">
        <tr>
		<td class="layui-td-gray">电话号码<font>*</font></td>
		<td colspan="3">
			<input type="text" name="phone" autocomplete="off" lay-verify="required|phone_format" lay-vertype="tips" lay-reqText="请输入电话号码" placeholder="请输入电话（支持手机/固话）" class="layui-input">
		</td>
	  </tr>
        <tr>
		<td class="layui-td-gray">电话描述</td>
		<td colspan="3">
			<textarea name="description" class="layui-textarea" placeholder="请输入描述信息" lay-verify="required" lay-reqText="请输入电话描述"></textarea>
		</td>
	  </tr>
        <tr>
		<td colspan="4" class="pt-4">
			<input type="hidden" name="court_id" value="{$court_id}">
			<button class="layui-btn layui-btn-normal" lay-submit lay-filter="webform">立即提交</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</td>
	  </tr>
    </table>
</form>
    </form>
</div>
{/block}
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
    var form = layui.form,tool=layui.tool;
    //监听提交
    form.on('submit(webform)', function (data) {
		let callback = function (e) {
			layer.msg(e.msg);
			if (e.code == 0) {
				tool.sideClose(1000,'courtTable');
			}
		}
		tool.post("/lawcase/court/addphone", data.field, callback);
		return false;
	});
}
</script>
{/block}